#include"shm.hpp"

int main()
{
    int n = 0;//记录消息数
    //获取共享内存
    int shmid = getshm();
    //关联共享内存
    char* shmem = (char*)shmat(shmid, nullptr, 0);

    while(true)
    {
        snprintf(shmem, max_mem, "我是client!,[消息数%d]", ++n);
        sleep(1);
    }
    //断连
    shmdt(shmem);
    return 0;
}